<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="css/wap.min.css" rel="stylesheet"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<style>
			.text-muted{
				margin:-1px 0 3px 10px;
			}
		</style>
		<title>系统设置</title>
	</head>
	<body>
		<table class="tabcaption"><tr><td class="h3">系统设置</td></tr></table>
		<table>
			<tbody>
				<tr><td>刷新间隔</td><td><input type="text" value="20" id="reflashtime"/>秒</td></tr>
				<tr><td>车辆显示</td><td><input type="radio" name="name" value="bName" id="bName" checked>车辆自编号<br><input type="radio" name="name" id="bCardID" value="bCardID">车牌号</td></tr>
				<tr><td>发车时间显示</td><td><input type="radio" name="name1" value="showDownTimetable" id="showDownTimetable" checked>仅显示下行<br><input type="radio" name="name1" id="showAllTimetable" value="showAllTimetable">显示上下行<br><input type="radio" name="name1" id="showNoneTimetable" value="showNoneTimetable">均不显示</td></tr>
				<tr><td>搜索框设置</td><td><input type="radio" name="name2" value="searchWaitbus" id="searchWaitbus" checked>不复用为百度输入框<p class="text-muted">推荐将智慧公交设为浏览器首页并选下方选项</p><input type="radio" name="name2" id="searchBaidu" value="searchBaidu">智能跳转百度搜索页<p class="text-muted">如要查中文站点，请以#开头，如：#泉城广场</p></td></tr>
				
				<tr><td colspan="2" style="text-align:center"><button id="save">保存</button></tr>
			</tbody>
		</table>
		<p>设置保存在浏览器，更换浏览器恢复默认设置</p>
		<p>  
			<a href="javascript:location.reload();">刷新</a>  
			<a href="javascript:history.go(-1);">后退</a>   
			<a href="about.html">关于</a>  
			<a href="/">首页</a>  
		</p>    
		<footer>©2013-2018 waitbus.com</footer>
		<script>
		if(!window.localStorage){
			alert("浏览器不支持本地存储设置");
			history.go(-1);
		}else{
			var storage=window.localStorage;
		}
		if(storage["reflashtime"]!=undefined){
			document.getElementById("reflashtime").value =  storage["reflashtime"];
			document.getElementById(storage["showname"]).checked=true ;
			document.getElementById(storage["showtimetable"]).checked=true ;
		}
		document.getElementById("save").addEventListener("click",function(){
			var b1= document.getElementsByName('name');
			for (var i = 0; i < b1.length; i++) {
				if (b1[i].checked == true) {
					storage["showname"] = b1[i].value;
				}
			}
			var b2= document.getElementsByName('name1');
			for (var i = 0; i < b2.length; i++) {
				if (b2[i].checked == true) {
					storage["showtimetable"] = b2[i].value;
				}
			}
			storage["reflashtime"] = document.getElementById("reflashtime").value;
			if(storage["reflashtime"]<10){
				storage["reflashtime"]=10;
				document.getElementById("reflashtime").value = storage["reflashtime"];
				alert("由于车辆信息30秒左右更新一次，过低的更新频率不能获取更佳的使用体验");
			}
			alert("保存成功");
			history.go(-1);
		});
		</script>
		<script src="https://hm.baidu.com/hm.js?3fb32ed63900b8d366e43a3d0b8d7e14"></script>
	</body>
</html>